package com.TestDemo;

import java.io.*;

public class Test02 {

    public static void main(String[] args) throws Exception {
        InputStream inputStream = null;
        OutputStream outputStream = null;

        File file = new File("src/com/TestDemo/123.txt");
        File file2 = new File("3.txt");

        inputStream = new FileInputStream(file);
        outputStream = new FileOutputStream(file2);


        int len = -1;
        byte[] buffer = new byte[1024];
        System.out.println("第一波buffer："+buffer.length);
        System.out.println("第二波buffer：" + (inputStream.read(buffer)));
        System.out.println("第一波buffer："+buffer.length);
        while ((len=inputStream.read(buffer))!=-1){
            outputStream.write(buffer,0,len);
        }
        outputStream.flush();



        inputStream.close();
        outputStream.close();

    }

}
